package com.tiancheng.trade.authserver.dto;

import com.tiancheng.trade.authserver.entity.AuthPermission;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;

import java.lang.reflect.InvocationTargetException;

@Getter
@Setter
@Accessors(chain = true)
@NoArgsConstructor
public class DataPermissionDTO {
    private String id;
    private String name;
    private String code;
    private String describe;

    public DataPermissionDTO(AuthPermission permission) throws InvocationTargetException, IllegalAccessException {
        if (permission != null) {
            BeanUtils.copyProperties(permission, this);
        }
    }
}
